.class public Lcom/netease/netstat/statistics/LookUpDnsTest;
.super Lcom/netease/netstat/statistics/BaseTest;
.source "LookUpDnsTest.java"


# direct methods
.method public constructor <init>(Landroid/telephony/TelephonyManager;Landroid/net/ConnectivityManager;Lcom/netease/netstat/utils/FileService;)V
    .locals 0
    .parameter "telephony"
    .parameter "connectivity"
    .parameter "file"

    .prologue
    .line 17
    invoke-direct {p0, p1, p2, p3}, Lcom/netease/netstat/statistics/BaseTest;-><init>(Landroid/telephony/TelephonyManager;Landroid/net/ConnectivityManager;Lcom/netease/netstat/utils/FileService;)V

    .line 18
    return-void
.end method


# virtual methods
.method public getdnstime([Ljava/lang/String;)V
    .locals 11
    .parameter "dns"

    .prologue
    .line 24
    const-wide/16 v5, 0x0

    .line 25
    .local v5, timedure:J
    const-wide/16 v7, 0x0

    .line 26
    .local v7, timeend:J
    const-wide/16 v3, 0x0

    .line 29
    .local v3, startTime:J
    sget-boolean v9, Lcom/netease/netstat/utils/Contanst;->airline:Z

    if-nez v9, :cond_0

    sget-boolean v9, Lcom/netease/netstat/utils/Contanst;->connectivity:Z

    if-eqz v9, :cond_0

    .line 31
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    :try_start_0
    array-length v9, p1
    :try_end_0
    .catch Ljava/net/UnknownHostException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    if-lt v1, v9, :cond_1

    .line 53
    :goto_1
    array-length v9, p1

    const/4 v10, 0x1

    if-le v9, v10, :cond_0

    .line 54
    long-to-float v9, v5

    array-length v10, p1

    int-to-float v10, v10

    div-float v0, v9, v10

    .line 55
    .local v0, averagetime:F
    invoke-static {v0}, Lcom/netease/netstat/utils/Contanst;->setDnsAveragetime(F)V

    .line 59
    .end local v0           #averagetime:F
    .end local v1           #i:I
    :cond_0
    return-void

    .line 32
    .restart local v1       #i:I
    :cond_1
    :try_start_1
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    .line 34
    aget-object v9, p1, v1

    invoke-static {v9}, Ljava/net/InetAddress;->getByName(Ljava/lang/String;)Ljava/net/InetAddress;

    move-result-object v2

    .line 35
    .local v2, inetaddress:Ljava/net/InetAddress;
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v7

    .line 38
    sub-long v9, v7, v3

    add-long/2addr v5, v9

    .line 40
    aget-object v9, p1, v1

    const-string v10, "c.3g.163.com"

    invoke-virtual {v9, v10}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v9

    if-eqz v9, :cond_2

    .line 43
    sub-long v9, v7, v3

    invoke-static {v9, v10}, Lcom/netease/netstat/utils/Contanst;->setDns163(J)V
    :try_end_1
    .catch Ljava/net/UnknownHostException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 31
    :cond_2
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 48
    .end local v2           #inetaddress:Ljava/net/InetAddress;
    :catch_0
    move-exception v9

    goto :goto_1

    .line 46
    :catch_1
    move-exception v9

    goto :goto_1
.end method
